/**
 * Copyright (c) 2023 myons Inc. All rights reserved.
 */
package cn.zmwh.portal.listener;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

import java.nio.charset.StandardCharsets;

/**
 * @describe: 授权过期回调 、
 * @author: dmzmwh 、
 * @time: 2023-06-25 9:36 、
 */
@Slf4j
@Component
public class RedisKeyOutListener implements MessageListener {

    @SneakyThrows
    @Override
    public void onMessage(Message message, byte[] bytes) {
        //过期的key
        String key = new String(message.getBody(), StandardCharsets.UTF_8);
        log.info(key);
    }
}
